﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace HealthVaultPowerShell
{
    /// <summary>
    /// Singleton Instance of HealthVaultShellUtilities
    /// </summary>
    public sealed class SingleTonHealthVaultShellUtilities
    {
        private static Guid powerShellGuid = new Guid("e43d65c4-52e2-4da2-8ee0-9cf508472370");
        private static Uri platformUrl = new Uri("https://platform.healthvault-ppe.com/platform/");
        private static Uri shellUrl = new Uri("https://account.healthvault-ppe.com/");
        private static volatile HealthVaultShellUtilities healthVaultUtilities;
        private static object syncRoot = new Object();

        public SingleTonHealthVaultShellUtilities()
        {
            healthVaultUtilities = new HealthVaultShellUtilities(powerShellGuid, platformUrl, shellUrl);
        }

        public static HealthVaultShellUtilities HealthVaultShellUtilInstance
        {
            get
            {
                if (healthVaultUtilities == null)
                {
                    lock (syncRoot)
                    {
                        if (healthVaultUtilities == null)
                            healthVaultUtilities = new HealthVaultShellUtilities(powerShellGuid, platformUrl, shellUrl);
                    }
                }
                return healthVaultUtilities;
            }
        }
    }
}
